3.11 \(\int \frac{d+e x+f x^2}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=51 \[ -\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)-\frac{1}{6} e \log \left (1-x^2\right )+\frac{1}{6} e \log \left (4-x^2\right ) \]

[Out]

-((d + 4*f)*ArcTanh[x/2])/6 + ((d + f)*ArcTanh[x])/3 - (e*Log[1 - x^2])/6 + (e*Log[4 - x^2])/6

________________________________________________________________________________________

Rubi [A]  time = 0.0566029, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 7, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.304, Rules used = {1673, 1166, 207, 12, 1107, 616, 31} \[ -\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)-\frac{1}{6} e \log \left (1-x^2\right )+\frac{1}{6} e \log \left (4-x^2\right ) \]

Antiderivative was successfully verified.

[In]

Int[(d + e*x + f*x^2)/(4 - 5*x^2 + x^4),x]

[Out]

-((d + 4*f)*ArcTanh[x/2])/6 + ((d + f)*ArcTanh[x])/3 - (e*Log[1 - x^2])/6 + (e*Log[4 - x^2])/6

Rule 1673

Int[(Pq_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{q = Expon[Pq, x], k}, Int[Sum[Coeff[
Pq, x, 2*k]*x^(2*k), {k, 0, q/2}]*(a + b*x^2 + c*x^4)^p, x] + Int[x*Sum[Coeff[Pq, x, 2*k + 1]*x^(2*k), {k, 0,
(q - 1)/2}]*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] &&  !PolyQ[Pq, x^2]

Rule 1166

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^
2 - 4*a*c]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 1107

Int[(x_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[Int[(a + b*x + c*x^2)^p, x],
 x, x^2], x] /; FreeQ[{a, b, c, p}, x]

Rule 616

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{d+e x+f x^2}{4-5 x^2+x^4} \, dx &=\int \frac{e x}{4-5 x^2+x^4} \, dx+\int \frac{d+f x^2}{4-5 x^2+x^4} \, dx\\ &=e \int \frac{x}{4-5 x^2+x^4} \, dx-\frac{1}{3} (d+f) \int \frac{1}{-1+x^2} \, dx+\frac{1}{3} (d+4 f) \int \frac{1}{-4+x^2} \, dx\\ &=-\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)+\frac{1}{2} e \operatorname{Subst}\left (\int \frac{1}{4-5 x+x^2} \, dx,x,x^2\right )\\ &=-\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)+\frac{1}{6} e \operatorname{Subst}\left (\int \frac{1}{-4+x} \, dx,x,x^2\right )-\frac{1}{6} e \operatorname{Subst}\left (\int \frac{1}{-1+x} \, dx,x,x^2\right )\\ &=-\frac{1}{6} (d+4 f) \tanh ^{-1}\left (\frac{x}{2}\right )+\frac{1}{3} (d+f) \tanh ^{-1}(x)-\frac{1}{6} e \log \left (1-x^2\right )+\frac{1}{6} e \log \left (4-x^2\right )\\ \end{align*}

Mathematica [A]  time = 0.0259607, size = 58, normalized size = 1.14 \[ \frac{1}{12} (-2 \log (1-x) (d+e+f)+\log (2-x) (d+2 e+4 f)+2 \log (x+1) (d-e+f)-\log (x+2) (d-2 e+4 f)) \]

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x + f*x^2)/(4 - 5*x^2 + x^4),x]

[Out]

(-2*(d + e + f)*Log[1 - x] + (d + 2*e + 4*f)*Log[2 - x] + 2*(d - e + f)*Log[1 + x] - (d - 2*e + 4*f)*Log[2 + x
])/12

________________________________________________________________________________________

Maple [B]  time = 0.007, size = 86, normalized size = 1.7 \begin{align*} -{\frac{\ln \left ( 2+x \right ) d}{12}}+{\frac{\ln \left ( 2+x \right ) e}{6}}-{\frac{\ln \left ( 2+x \right ) f}{3}}+{\frac{\ln \left ( 1+x \right ) d}{6}}-{\frac{\ln \left ( 1+x \right ) e}{6}}+{\frac{\ln \left ( 1+x \right ) f}{6}}+{\frac{\ln \left ( x-2 \right ) d}{12}}+{\frac{\ln \left ( x-2 \right ) e}{6}}+{\frac{\ln \left ( x-2 \right ) f}{3}}-{\frac{\ln \left ( x-1 \right ) d}{6}}-{\frac{\ln \left ( x-1 \right ) e}{6}}-{\frac{\ln \left ( x-1 \right ) f}{6}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

-1/12*ln(2+x)*d+1/6*ln(2+x)*e-1/3*ln(2+x)*f+1/6*ln(1+x)*d-1/6*ln(1+x)*e+1/6*ln(1+x)*f+1/12*ln(x-2)*d+1/6*ln(x-
2)*e+1/3*ln(x-2)*f-1/6*ln(x-1)*d-1/6*ln(x-1)*e-1/6*ln(x-1)*f

________________________________________________________________________________________

Maxima [A]  time = 0.963057, size = 69, normalized size = 1.35 \begin{align*} -\frac{1}{12} \,{\left (d - 2 \, e + 4 \, f\right )} \log \left (x + 2\right ) + \frac{1}{6} \,{\left (d - e + f\right )} \log \left (x + 1\right ) - \frac{1}{6} \,{\left (d + e + f\right )} \log \left (x - 1\right ) + \frac{1}{12} \,{\left (d + 2 \, e + 4 \, f\right )} \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

-1/12*(d - 2*e + 4*f)*log(x + 2) + 1/6*(d - e + f)*log(x + 1) - 1/6*(d + e + f)*log(x - 1) + 1/12*(d + 2*e + 4
*f)*log(x - 2)

________________________________________________________________________________________

Fricas [A]  time = 2.0685, size = 170, normalized size = 3.33 \begin{align*} -\frac{1}{12} \,{\left (d - 2 \, e + 4 \, f\right )} \log \left (x + 2\right ) + \frac{1}{6} \,{\left (d - e + f\right )} \log \left (x + 1\right ) - \frac{1}{6} \,{\left (d + e + f\right )} \log \left (x - 1\right ) + \frac{1}{12} \,{\left (d + 2 \, e + 4 \, f\right )} \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

-1/12*(d - 2*e + 4*f)*log(x + 2) + 1/6*(d - e + f)*log(x + 1) - 1/6*(d + e + f)*log(x - 1) + 1/12*(d + 2*e + 4
*f)*log(x - 2)

________________________________________________________________________________________

Sympy [B]  time = 33.0575, size = 2195, normalized size = 43.04 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

-(d - 2*e + 4*f)*log(x + (-35*d**5*e + 51*d**5*(d - 2*e + 4*f)/2 - 820*d**4*e*f + 90*d**4*f*(d - 2*e + 4*f) -
180*d**3*e**3 - 90*d**3*e**2*(d - 2*e + 4*f) - 4100*d**3*e*f**2 + 41*d**3*e*(d - 2*e + 4*f)**2 + 42*d**3*f**2*
(d - 2*e + 4*f) - 15*d**3*(d - 2*e + 4*f)**3/2 - 432*d**2*e**2*f*(d - 2*e + 4*f) - 8000*d**2*e*f**3 + 240*d**2
*e*f*(d - 2*e + 4*f)**2 - 240*d**2*f**3*(d - 2*e + 4*f) - 12*d**2*f*(d - 2*e + 4*f)**3 + 320*d*e**5 - 96*d*e**
4*(d - 2*e + 4*f) + 720*d*e**3*f**2 - 80*d*e**3*(d - 2*e + 4*f)**2 - 1080*d*e**2*f**2*(d - 2*e + 4*f) + 24*d*e
**2*(d - 2*e + 4*f)**3 - 6400*d*e*f**4 + 492*d*e*f**2*(d - 2*e + 4*f)**2 - 576*d*f**4*(d - 2*e + 4*f) + 30*d*f
**2*(d - 2*e + 4*f)**3 + 512*e**5*f - 128*e**3*f*(d - 2*e + 4*f)**2 - 576*e**2*f**3*(d - 2*e + 4*f) - 1472*e*f
**5 + 320*e*f**3*(d - 2*e + 4*f)**2 - 480*f**5*(d - 2*e + 4*f) + 48*f**3*(d - 2*e + 4*f)**3)/(9*d**6 + 45*d**5
*f - 160*d**4*e**2 - 36*d**4*f**2 - 1312*d**3*e**2*f - 360*d**3*f**3 + 256*d**2*e**4 - 3840*d**2*e**2*f**2 - 1
44*d**2*f**4 + 1280*d*e**4*f - 5248*d*e**2*f**3 + 720*d*f**5 + 1024*e**4*f**2 - 2560*e**2*f**4 + 576*f**6))/12
 + (d - e + f)*log(x + (-35*d**5*e - 51*d**5*(d - e + f) - 820*d**4*e*f - 180*d**4*f*(d - e + f) - 180*d**3*e*
*3 + 180*d**3*e**2*(d - e + f) - 4100*d**3*e*f**2 + 164*d**3*e*(d - e + f)**2 - 84*d**3*f**2*(d - e + f) + 60*
d**3*(d - e + f)**3 + 864*d**2*e**2*f*(d - e + f) - 8000*d**2*e*f**3 + 960*d**2*e*f*(d - e + f)**2 + 480*d**2*
f**3*(d - e + f) + 96*d**2*f*(d - e + f)**3 + 320*d*e**5 + 192*d*e**4*(d - e + f) + 720*d*e**3*f**2 - 320*d*e*
*3*(d - e + f)**2 + 2160*d*e**2*f**2*(d - e + f) - 192*d*e**2*(d - e + f)**3 - 6400*d*e*f**4 + 1968*d*e*f**2*(
d - e + f)**2 + 1152*d*f**4*(d - e + f) - 240*d*f**2*(d - e + f)**3 + 512*e**5*f - 512*e**3*f*(d - e + f)**2 +
 1152*e**2*f**3*(d - e + f) - 1472*e*f**5 + 1280*e*f**3*(d - e + f)**2 + 960*f**5*(d - e + f) - 384*f**3*(d -
e + f)**3)/(9*d**6 + 45*d**5*f - 160*d**4*e**2 - 36*d**4*f**2 - 1312*d**3*e**2*f - 360*d**3*f**3 + 256*d**2*e*
*4 - 3840*d**2*e**2*f**2 - 144*d**2*f**4 + 1280*d*e**4*f - 5248*d*e**2*f**3 + 720*d*f**5 + 1024*e**4*f**2 - 25
60*e**2*f**4 + 576*f**6))/6 - (d + e + f)*log(x + (-35*d**5*e + 51*d**5*(d + e + f) - 820*d**4*e*f + 180*d**4*
f*(d + e + f) - 180*d**3*e**3 - 180*d**3*e**2*(d + e + f) - 4100*d**3*e*f**2 + 164*d**3*e*(d + e + f)**2 + 84*
d**3*f**2*(d + e + f) - 60*d**3*(d + e + f)**3 - 864*d**2*e**2*f*(d + e + f) - 8000*d**2*e*f**3 + 960*d**2*e*f
*(d + e + f)**2 - 480*d**2*f**3*(d + e + f) - 96*d**2*f*(d + e + f)**3 + 320*d*e**5 - 192*d*e**4*(d + e + f) +
 720*d*e**3*f**2 - 320*d*e**3*(d + e + f)**2 - 2160*d*e**2*f**2*(d + e + f) + 192*d*e**2*(d + e + f)**3 - 6400
*d*e*f**4 + 1968*d*e*f**2*(d + e + f)**2 - 1152*d*f**4*(d + e + f) + 240*d*f**2*(d + e + f)**3 + 512*e**5*f -
512*e**3*f*(d + e + f)**2 - 1152*e**2*f**3*(d + e + f) - 1472*e*f**5 + 1280*e*f**3*(d + e + f)**2 - 960*f**5*(
d + e + f) + 384*f**3*(d + e + f)**3)/(9*d**6 + 45*d**5*f - 160*d**4*e**2 - 36*d**4*f**2 - 1312*d**3*e**2*f -
360*d**3*f**3 + 256*d**2*e**4 - 3840*d**2*e**2*f**2 - 144*d**2*f**4 + 1280*d*e**4*f - 5248*d*e**2*f**3 + 720*d
*f**5 + 1024*e**4*f**2 - 2560*e**2*f**4 + 576*f**6))/6 + (d + 2*e + 4*f)*log(x + (-35*d**5*e - 51*d**5*(d + 2*
e + 4*f)/2 - 820*d**4*e*f - 90*d**4*f*(d + 2*e + 4*f) - 180*d**3*e**3 + 90*d**3*e**2*(d + 2*e + 4*f) - 4100*d*
*3*e*f**2 + 41*d**3*e*(d + 2*e + 4*f)**2 - 42*d**3*f**2*(d + 2*e + 4*f) + 15*d**3*(d + 2*e + 4*f)**3/2 + 432*d
**2*e**2*f*(d + 2*e + 4*f) - 8000*d**2*e*f**3 + 240*d**2*e*f*(d + 2*e + 4*f)**2 + 240*d**2*f**3*(d + 2*e + 4*f
) + 12*d**2*f*(d + 2*e + 4*f)**3 + 320*d*e**5 + 96*d*e**4*(d + 2*e + 4*f) + 720*d*e**3*f**2 - 80*d*e**3*(d + 2
*e + 4*f)**2 + 1080*d*e**2*f**2*(d + 2*e + 4*f) - 24*d*e**2*(d + 2*e + 4*f)**3 - 6400*d*e*f**4 + 492*d*e*f**2*
(d + 2*e + 4*f)**2 + 576*d*f**4*(d + 2*e + 4*f) - 30*d*f**2*(d + 2*e + 4*f)**3 + 512*e**5*f - 128*e**3*f*(d +
2*e + 4*f)**2 + 576*e**2*f**3*(d + 2*e + 4*f) - 1472*e*f**5 + 320*e*f**3*(d + 2*e + 4*f)**2 + 480*f**5*(d + 2*
e + 4*f) - 48*f**3*(d + 2*e + 4*f)**3)/(9*d**6 + 45*d**5*f - 160*d**4*e**2 - 36*d**4*f**2 - 1312*d**3*e**2*f -
 360*d**3*f**3 + 256*d**2*e**4 - 3840*d**2*e**2*f**2 - 144*d**2*f**4 + 1280*d*e**4*f - 5248*d*e**2*f**3 + 720*
d*f**5 + 1024*e**4*f**2 - 2560*e**2*f**4 + 576*f**6))/12

________________________________________________________________________________________

Giac [A]  time = 1.10251, size = 80, normalized size = 1.57 \begin{align*} -\frac{1}{12} \,{\left (d + 4 \, f - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) + \frac{1}{6} \,{\left (d + f - e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac{1}{6} \,{\left (d + f + e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac{1}{12} \,{\left (d + 4 \, f + 2 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

-1/12*(d + 4*f - 2*e)*log(abs(x + 2)) + 1/6*(d + f - e)*log(abs(x + 1)) - 1/6*(d + f + e)*log(abs(x - 1)) + 1/
12*(d + 4*f + 2*e)*log(abs(x - 2))